package com.icehand.payment.model;

import com.alibaba.fastjson.JSONObject;
import com.icehand.common.code.CodeEnum;
import com.icehand.common.enums.PayChannelEnum;
import com.icehand.common.model.BaseOrder;
import com.icehand.common.result.BizResult;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.servlet.http.HttpServletRequest;

/**
 * @author icehand
 */
@Data
@Accessors(chain = true)
public class NotifyWrapper {
    private HttpServletRequest request;
    private PayChannelEnum payChannelEnum;
    private JSONObject config;
    private Integer appId;

    /**
     * 输出订单
     */
    private BizResult<BaseOrder> bizResult;

    public void error(CodeEnum<Integer> codeEnum){
        bizResult.setCode(codeEnum.getCode());
        bizResult.setMsg(codeEnum.getMsg());
    }
}
